<?php

//require("../library/const.php");

class Index_View{
	var $arrNeedUpdate;
	
	function _construct($arr){
		$this->arrNeedUpdate = $arr;		
	}

	function ShowNeedUpdate(){
		
		//include("../library/xml.class/xml.class.php");
		//include("../application/models/Index_Model.php");
		//$x = new Index_Model();
		//$x->Url("../library/cache.xml");
		//$arrNeedUpdate = $x->GetXmlCache();
		
		$html =  "<center><div class='width90'>
				<div class='contentTitle color2A4580'><b>THÔNG TIN CẦN CẬP NHẬT</b></div>
				<center>";
		$i = 0;
		foreach($this->arrNeedUpdate as $type=>$infos){
			if($i==1)
				$html .=  "<div class='article borderLeft'>
				<div class='articleTitle borderBottom'>";
			else
				$html .=  "<div class='article'>
				<div class='articleTitle borderBottom'>";
			switch($type){
				case "ngay":
					$html .=  "Ngày"; break;
				case "thang":
					$html .=  "Tháng"; break;
				case "quy":
					$html .=  "Quý"; break;
				case "nam":
					$html .=  "Năm"; break;
			}
			$html .=  "</div>";
			$url = NULL;			
			foreach($infos as $info){
				$url = $info['Url']."?ma=".$info['Ma'];
				$html .=  "<div class='articleContent'><a href='".$url."'>".$info['Ten']."</a></div>";
			}
			$html .=  "</div> <!--END OF ARTICLE-->";
			if($i==1){
				$html .=  "<div class='cClear'></div>
					<div class='hrLine'></div>";
				$i=0;
			}				
			else{				
				$i++;
			}
		}
		$html .=  "</center></div></center>";
		return $html;
	}
		
			
}
?>